/*
 * Node.java - ScriptME
 * 
 * Copyright (c) 2009 Cesar Henriques <cesar at alttab.com.ar>.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Based on FESI Project
 * 
 * Contributors:
 * 	Jean-Marc Lugrin - initial API and implementation
 * 	Cesar Henriques <cesar at alttab.com.ar> - J2ME Porting and Extensions
 */
/*
 * 
 */

package org.scriptme.ecmascript.ast;

// TODO: Auto-generated Javadoc
/*
 * All AST nodes must implement this interface. It provides basic machinery for
 * constructing the parent and child relationships between nodes.
 */

/**
 * The Interface Node.
 */
public interface Node {

	/**
	 * This method is called after the node has been made the current node. It
	 * indicates that child nodes can now be added to it.
	 */
	public void jjtOpen();

	/**
	 * This method is called after all the child nodes have been added.
	 */
	public void jjtClose();

	/**
	 * This pair of methods are used to inform the node of its parent.
	 * 
	 * @param n
	 *            the n
	 */
	public void jjtSetParent(Node n);

	/**
	 * Jjt get parent.
	 * 
	 * @return the node
	 */
	public Node jjtGetParent();

	/**
	 * This method tells the node to add its argument to the node's list of
	 * children.
	 * 
	 * @param n
	 *            the n
	 * @param i
	 *            the i
	 */
	public void jjtAddChild(Node n, int i);

	/**
	 * This method returns a child node. The children are numbered from zero,
	 * left to right.
	 * 
	 * @param i
	 *            the i
	 * 
	 * @return the node
	 */
	public Node jjtGetChild(int i);

	/**
	 * Return the number of children the node has.
	 * 
	 * @return the int
	 */
	public int jjtGetNumChildren();

	/**
	 * Accept the visitor. *
	 * 
	 * @param visitor
	 *            the visitor
	 * @param data
	 *            the data
	 * 
	 * @return the object
	 */
	public Object jjtAccept(EcmaScriptVisitor visitor, Object data);
}
